package com.dhcc.android.base.common.view;

import android.graphics.drawable.BitmapDrawable;
import android.view.View;
import android.view.WindowManager;
import android.widget.PopupWindow;

import com.dhcc.android.base.R;

/**
 * webview的进度条适配器
 * 
 * @author pengling
 * 
 */
@SuppressWarnings("deprecation")
public class MyPopupWindow extends PopupWindow {
	@SuppressWarnings("unused")
	private PopupWindow popupWindow;

	public MyPopupWindow(View contentView, int width, int height, Boolean isOutsideTouchable) {
		super(contentView, width, height);
		setAnimationStyle(R.style.PopupBottomAnimation);
		setFocusable(true);
		// 设置允许在外点击消失
		setOutsideTouchable(isOutsideTouchable);
		// 这个是为了点击“返回Back”也能使其消失，并且并不会影响你的背景
		setBackgroundDrawable(new BitmapDrawable());
		// 防止虚拟软键盘被弹出菜单遮住
		setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
		setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
		update();
	}

}
